function sum(...numbers:number[]):number{
    return numbers.reduce((res,num)=>res+num,0);
}
let a:number=sum(1,2,3,4);
console.log(a);